package com.tdkj.model.decorate;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;

/**
 * 
 */
@Entity
@Table(name = "decorate_layout")
public class BeanLayout extends BaseEntity {

	//布局的展开方向，左到右，上到下 left-right top-bottom
	private String expandDirection;
	//展开比例
	private Integer expandProportion;
	private BeanLayout parent;
	
	//有序
	private List<BeanLayout> children;
	
	public String getExpandDirection() {
		return expandDirection;
	}
	public void setExpandDirection(String expandDirection) {
		this.expandDirection = expandDirection;
	}
	public Integer getExpandProportion() {
		return expandProportion;
	}
	public void setExpandProportion(Integer expandProportion) {
		this.expandProportion = expandProportion;
	}
	
	@OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.ALL}, mappedBy="parent")
	public List<BeanLayout> getChildren() {
		return children;
	}
	public void setChildren(List<BeanLayout> children) {
		this.children = children;
	}
	@ManyToOne(fetch=FetchType.LAZY, cascade={CascadeType.REFRESH})
	@JoinColumn(name="parent_id")
	public BeanLayout getParent() {
		return parent;
	}
	public void setParent(BeanLayout parent) {
		this.parent = parent;
	}
	

}